<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-员工列表">
</@frame.head>
  
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span>文章管理<span class="c-gray en">&gt;</span>编辑公告信息 <span class="c-gray en"> </span>  <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
 <!--  编辑头开始 -->
 <head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		<title>审核公告信息</title>
	<!-- 	<link media="all" rel="stylesheet" href="<%=path%>/admin/css/style.css" type="text/css" /> -->
	    <script type="text/javascript" src="${contextPath}/resources/js/tool/ckeditor/ckeditor.js"></script>
   		<script type="text/javascript" src="${contextPath}/resources/js/jquery-1.3.2.min.js"></script>

 
	</head>
	<body>

		<div id="wrapper" class="w970">
			 

			<div id="container_wrap">
				<div id="container">
					 
					<form method="post" name="query_order_form"  id="query_notice" action="${contextPath}/notice/notice_check" > 
						 <input class="text" name="id"
													value="${notice.id}" type="hidden" />
						<div id="main_content" class="fl">
							 
							<div class="order">
								<div class="filter">
								
									<div class="input_common">
										<ul>
											<li>
												<label for="">
													标题：
												</label>
												 
												<input class="text" name="title"
													value="${notice.title}" type="text" id="title" maxlength="25" />
											</li>

											<li>
												<label for="">
													状态：
												</label>
												
 													<select id="status"  disabled="disabled"  >
 													<#if notice.status==184>
 													 <option value="184" selected="selected" >待审核 </option>
 													<#elseif notice.status==185>
 													<option value="185" selected="selected" >审核通过 </option>
 													<#else>
 													 <option value="186" selected="selected" >审核未通过 </option>
 													</#if>
													  
													</select>
													<input value="184" type="hidden" id="hstatus" name="status" >
											</li>
 
											<li>
												<label for="">
													类型：
												</label>
												 
											 	<#if   dictionaryMap??  >
											  	   ${ dictionaryMap[""+notice.sysDictionaryId+""]	}
                        	 					</#if>
                        	 
											</li>
                                              
                                              <li><label for="">
													内容：
												</label></li>
                                            </ul>
										
										<textarea  id="content" name="content" onKeyUp="javascript:var val = this.value;if(val.length>100){this.value=val.substring(0,100)}">${notice.content}</textarea> 
									             <script type="text/javascript">
									      	        CKEDITOR.replace('content',
									      	        		{
									      	        	    filebrowserUploadUrl : '${contextPath}/ckeditor/uploader?Type=File',
									      	        		filebrowserImageUploadUrl : '${contextPath}/ckeditor/uploader?Type=Image',
									      	        		filebrowserFlashUploadUrl : '${contextPath}/ckeditor/uploader?Type=Flash'
									      	        		});
									             </script>
									          <!--   filebrowserUploadUrl : '${contextPath}/ckeditor/uploader?Type=File&uploadModel=helpInfo',
							      	        	filebrowserImageUploadUrl : '${contextPath}/ckeditor/uploader?Type=Image&uploadModel=helpInfo',
							      	        	filebrowserFlashUploadUrl : '${contextPath}/ckeditor/uploader?Type=Flash&uploadModel=helpInfo'
      	        	 							-->
									    <div style="text-align:center;padding-top:10px;">
									    
								<!-- 	    <input class="btn btn-success" type="button" value="审核通过" onclick="return checkForm(185)" />
									      <input class="btn btn-success" type="button" value="审核不通过" onclick="return checkForm(186)" /> -->
													  <!-- return checkForm() -->
									    </div>
									           
									</div>
							
								</div>
							</div>
						</div>



					</s:form>
					<div class="clear"></div>

				</div>



			</div>
		</div>

<script type="text/javascript">	
 
     
	         //表单提交验证
	function checkForm( idState)
		{
		 	             var re = /^[1-9]+[0-9]*]*$/;
				 	     var title=$('#title').val();
				 	     //var roworder=$('#roworder').val();
				 	     var type=$('#type').val();
				 	     var status=$('#status').val();
				 	     
				 	     var content=CKEDITOR.instances.content.getData();
				 	     var content1 = $("#content").val();
				 	     
				 	     if(title.length==0)
					     {
						    // alert("标题不能为空!");
						    layer.msg('标题不能为空!',{icon:1,time:1000},function(){
						    	  document.query_order_form.title.focus();
								   return ;
						    });
		                   
					     }
					     
					     if(status=="0")
					     {
						    // alert("请选择状态!");
						     layer.msg('请选择状态!',{icon:1,time:1000},function(){
						    	 document.query_order_form.status.focus();
							     return ;
						     });

		                    
					     }
					     //验证不能输入全部为空格的
			             function trim(str){ 
							 return  str.replace(/^\s+|\s+$/g,"");
					     }
					     if(trim(title)==''){
								//alert("请输入正确的标题！");
								layer.msg('请输入正确的标题！',{icon:1,time:1000},function(){
									
								return false;
								});

						     }
					     //验证只能输入汉字字符和下划线
					       var pattern =/(^[\u4e00-\u9fa5A-Za-z0-9_-]*$)/;
					       if(!pattern.test(title)){
								//alert("请输入正确的标题！");
								layer.msg('请输入正确的标题！',{icon:1,time:1000},function(){
									
									return false;
								});

								
					         }
					      //验证不能为纯数字
					      var pattern1 = /^\d+$/;
					    	 if(pattern1.test(title)){
								//alert("请输入正确的标题！");
								layer.msg('请输入正确的标题！',{icon:1,time:1000},function(){
									
								return false;
								});

					         }   
					    if(title.length>200){
								//alert("标题的长度不能大于200个字符！");
								layer.msg('标题的长度不能大于200个字符！',{icon:1,time:1000},function(){
									
								return false;
								});

						    }
					    if(trim(content)==''){
								//alert("请输入正确的内容！");
								layer.msg('请输入正确的内容！',{icon:1,time:1000},function(){
									
								return false;
								});

						    }
					  
					     
					     if(type=="0")
					     {
						    // alert("请选择类型!");
						     layer.msg('请选择类型',{icon:1,time:1000},function(){
									
		                     document.query_order_form.type.focus();
									return false;
									});
						     
					     }
					     
					     
					     if(content.length==0)
					     {
						     //alert("内容不能为空!");
						     layer.msg('内容不能为空',{icon:1,time:1000},function(){
									
						    	    document.query_order_form.content.focus();
										return false;
										});
						 
						      
					     }
					   //  if(content.length>4000){
					   //  	alert("内容长度不能超过100个字符！");
					   //  	return;
					  //   }
					     ajaxSubmitForm(idState);
					   
 } 
	         
function ajaxSubmitForm(idState){
	 
	$("#hstatus").val(idState)
	 $("#query_notice").ajaxSubmit({
			dataType : 'html',
	        success: function(message){
	        		if(message == "200"){
	                    layer.msg('审核通过!',{icon:1,time:1000},function(){
	 
	                        parent.window.location.reload();
	                    });
	 				}else if(message == "500"){
	 					layer.alert("系统繁忙！");
	 				}else{
	 					layer.alert(message);
	 				}
	        },
	        error: function(){
	            layer.msg('操作失败!',{icon:5,time:1000});
	        }
	    });
	
}	         
		
		function checkRoworder()
		{
	          var roworder=$("#roworder").val(); 
	   	       if(isNaN(roworder)){
	   	      	  //  alert("公告序号必须为数字类型！");
	   	      	layer.msg('公告序号必须为数字类型！',{icon:1,time:1000},function(){});

	   	      	    $("#roworder").val("");     
	   	      	   
	   	       }
		}
        
        $(function(){				
				var sta= "" ;
			
                if(sta==null||sta=="undefined")
	            {
					document.getElementById("status").value=184;
					document.getElementById("status").disabled="disabled";
				}
	    });
</script>



	</body>
 <!--  编辑尾结束 -->
 
<@frame.end "default">
</@frame.end>
 
<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/brand/query_brand.js"></script>
<script type="text/javascript">
 
</script>